﻿@using KRM.Core
@model KRM.Core.LP_Drivers
@{
    KRMEntities db = new KRMEntities();
    string name = "";
    try
    {
        name = Model.DriverName ?? db.tblUsers.Find(Model.UserID).Username;
    }
    catch (Exception)
    {


    }       
}

<form class="margin0" method="POST" action="/Users/managerdriver" id="managerdriver">
    <input type="hidden" value="@Model.UserID" name="UserID"/>
    <input type="hidden" value="@Model.DriverID" name="DriverID"/>
    <div style="padding: 20px 10px">
        <fieldset>
            <legend></legend>
            <div class="row-fluid">

                <div class="span3">Driver Name</div>
                <div class="span8">
                    <input type="text" class="input-block-level" required="required" name="DriverName"  value="@name"/>
                </div>
            </div>

            <div class="row-fluid">
                <div class="span3">Driver Telephone Number</div>
                <div class="span8">
                    <input type="text" class="input-block-level" name="DriverTelephoneNumber" value="@Model.DriverTelephoneNumber"/>
                </div>
            </div>
            <div class="row-fluid">
                <span class="span1"></span>
                <div class="span2"></div>

                <div class="span2">
                    <label>
                        @Html.CheckBox("Archived", @Model.Archived == false || @Model.Archived == null ? false : true, new { @class = "cbcheck" }) Is Admin
                    </label>
                </div>
            </div>
        </fieldset>

        <div class="border-padding10 text-center">
            <input type="submit" class="btn  btn-success " style="padding-left: 40px; padding-right: 40px" value="Save" />

            <button class="btn w100" data-dismiss="modal" aria-hidden="true">Cancel</button>
        </div>

    </div>
</form>


